package com.matt.foundation.utils;


import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;

public class PoiUtils{

    public static boolean setupCellTableStyle(CellStyle style){
        style.setAlignment(HorizontalAlignment.CENTER);
        style.setVerticalAlignment(VerticalAlignment.CENTER);

        style.setBorderBottom(BorderStyle.THIN);
        style.setBorderLeft(BorderStyle.THIN);
        style.setBorderRight(BorderStyle.THIN);
        style.setBorderTop(BorderStyle.THIN);

        return true;
    }

    public static boolean setupCellTableHead(CellStyle style){
//        style.setFillForegroundColor(HSSFColor.SEA_GREEN.index);
//        style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
//        style.setFillBackgroundColor(HSSFColor.SEA_GREEN.index);
        style.setFillForegroundColor(HSSFColor.HSSFColorPredefined.SEA_GREEN.getIndex());
        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
        style.setFillBackgroundColor(HSSFColor.HSSFColorPredefined.SEA_GREEN.getIndex());

        return true;
    }

}
